home *** CD-ROM | disk | FTP | other *** search
/ Archive Magazine CD 1995 / Archive Magazine CD 1995.iso / discs / prog_disc / volume_3 / issue02 / extras / statistics / procs next >
Encoding:
Text File  |  1989-10-04  |  5.5 KB  |  107 lines

  1. >L.10000,13000
  2.  
  3. 10000DEFPROCload
  4.  
  5. 10005PRINT:INPUT"Enter No.of results",N9:PRINT"Enter ";N9;" values"
  6.  
  7. 10020FOR K%=0 TO arraysize%: FOR I=1 TO 240:IF K%*240+I=N9+1 K%=arraysize%:I=240 ELSE PRINT"ENTER X1(";K%*240+I;")";:INPUT X1(I,K%)
  8.  
  9. 10050NEXT:NEXT
  10.  
  11. 10060INPUT"Enter a description of the data",A$
  12.  
  13. 10070ENDPROC
  14.  
  15. 10075:
  16.  
  17. 10080DEFPROCdisp:LOCAL K%,L%,M%,P%,Q%,K9
  18.  
  19. 10082K%=0:lo%=0:IF N9=0 PRINT'"◰‡⇦Ŵ>  NO  DATA  <⇨"':del=INKEY(250):ENDPROC
  20.  
  21. 10085FOR K%=0 TO N9 DIV 240:IF N9-K%*240>239 THEN O%=3 ELSE O%=(N9-K%*240-1)DIV 60
  22.  
  23. 10090FOR L%=0 TO O%:K9=L%:CLS
  24.  
  25. 10100FOR M%=0 TO 2:Q%=K%*240+L%*60: IF  Q%>999 PRINTTAB(5,2);"‹‡⇦ŴINDEX ";LEFT$(STR$(Q%),1);" THOUSAND,..‹”";
  26.  
  27. 10110FOR P%=1 TO 20
  28.  
  29. 10120PRINTTAB(M%*13,P%+2);RIGHT$(STR$(K%*240+L%*60+M%*20+P%),3);TAB(M%*13+4,P%+2);FNusing(shape$,X1(L%*60+M%*20+P%,K%));
  30.  
  31. 10140NEXTP%:NEXTM%
  32.  
  33. 10145IF F4=1 PROCamend
  34.  
  35. 10146IF F4=2 PROCdelete
  36.  
  37. 10147IF F4=3 PROCinsert
  38.  
  39. 10150NEXTL%:NEXT K%:@%=&10:ENDPROC
  40.  
  41. 10155:
  42.  
  43. 10160DEFPROCamend:LOCAL lo%,I%,R%
  44.  
  45. 10170PRINTTAB(0,1);"◰‡ŴAMEND ROUTINE  †Amend data Y/N?       ":SW$=GET$:IF SW$<>"Y" AND SW$<>"y" THEN CLS:ENDPROC
  46.  
  47. 10180PRINTTAB(0,1);"Enter array subscripts of each value to be amended then zero to terminate":del=INKEY(100)
  48.  
  49. 10190lo%=0
  50.  
  51. 10200REPEAT:lo%=lo%+1:PRINTTAB(0,1);STRING$(75," ");TAB(5,1);:INPUT"Next subscript",I%(lo%):PRINTI%(lo%),K%*240+L%*60+60 :PRINTTAB(0,0)STRING$(15," "):UNTIL I%(lo%)>K%*240+L%*60+60 OR I%(lo%)<K%*240+L%*60+1 OR I%(lo%)>N9 OR I%(lo%)=0
  52.  
  53. 10210IF I%(lo%)<>0 THEN PRINTTAB(0,0)"Ŷ⇦Out of range":lo%=lo%-1:GOTO 10200
  54.  
  55. 10220T=lo%:FOR lo%=1 TO T-1:R%=I%(lo%)DIV240:S%=I%(lo%)MOD240:IF S%=0 S%=240:R%=R%-1
  56.  
  57. 10230PRINTTAB(0,1);STRING$(75," ")TAB(0,1);"Old value of X1(";I%(lo%);")=";X1(S%,R%);" New value?";:INPUTX1(S%,R%)
  58.  
  59. 10232PROCposn
  60.  
  61. 10235PRINTTAB(J9*13+4,I9+2);STRING$(9," ");TAB(J9*13+4,I9+2);FNusing(shape$,X1(S%,R%));
  62.  
  63. 10240NEXT:GOTO 10170
  64.  
  65. 10250CLS:ENDPROC
  66.  
  67. 10260DEFPROCinput(D$)
  68.  
  69. 10270LOCAL P%,Q%,del,N%,J%,K%
  70.  
  71. 10340PRINT'"Enter the following:-":OSCLI ("mount "+STR$(inc%))
  72.  
  73. 10350PRINT"  File reference code":INPUTref$:IF ASC(dird$)<>-1 OSCLI ("DIR "+dird$)
  74.  
  75. 10360IF D$="F" OR D$="f" INPUT"  No.of DATA values from this file"'"  Position No.of first DATA value",P%,Q% ELSE P%=N9:Q%=1
  76.  
  77. 10370QQ%=Q%
  78.  
  79. 10380PRINTref$
  80.  
  81. 10390f=OPENUP(ref$)
  82.  
  83. 10420IF f=0 PRINT'"Ŷ⇦File ";ref$;" not found":GOTO 10340
  84.  
  85. 10430INPUT#f,A$,N%:NN%=N%
  86.  
  87. 10450IF N%-Q%+1<P% PRINT'"ŵ⇦Insufficient data":CLOSE#f:GOTO 10340
  88.  
  89. 10460IF Q%=1 THEN 10480
  90.  
  91. 10470FOR R%=1 TO Q%-1:INPUT#f,Xdum:NEXT
  92.  
  93. 10480FOR R%=Q% TO Q%+P%-1:Z%=Z%+1:J%=Z% MOD240:K%=Z% DIV240
  94.  
  95. 10490INPUT#f,X1(J%,K%)
  96.  
  97. 10500NEXT
  98.  
  99. 10510CLOSE#f:ENDPROC
  100.  
  101. 10515:
  102.  
  103. 10520DEFPROCsave:IF N9=0 PRINT'"◰‡⇦Ŵ>  NO  DATA  <⇨"':del=INKEY(250):ENDPROC
  104.  
  105. 10530INPUT'"Enter file reference code(limit 10chrs)",ref$
  106.  
  107. 10535REPEAT:PRINT"◰‡ŴPlain numeric file Y? else return";:SW$=GET$:UNTIL LEN(SW$)=1 OR LEN(SW$)=0
  108.  
  109. 10540PRINT'"ŵ⇦ENSURE DATA DISC IS PRESENT"'" ŷSelect FULL directory pathname ":INPUT dir$
  110.  
  111. 10550IF ASC(dir$)>31 OSCLI "DIR "+dir$  ELSE GOTO 10540
  112.  
  113. 10570f=OPENOUT(ref$)
  114.  
  115. 10580IF SW$ <>"Y" PRINT#f,A$,N9
  116.  
  117. 10590FOR K%=0 TO arraysize%: FOR I=1 TO 240:IF K%*240+I=N9+1 K%=arraysize%:I=240 ELSE PRINT#f,X1(I,K%)
  118.  
  119. 10600NEXT:NEXT:CLOSE #f
  120.  
  121. 10610ENDPROC
  122.  
  123. 10615:
  124.  
  125. 10700DEFPROCposn
  126.  
  127. 10710J9=(I%(lo%)MOD240-K9*60)DIV20:I9=(I%(lo%)-K9*60)MOD20:IF I9=0 THEN J9=J9-1:I9=20
  128.  
  129. 10720IF I%(lo%)MOD240=0 J9=2
  130.  
  131. 10721ENDPROC
  132.  
  133. 10725:
  134.  
  135. 10950DEFPROCfil(C):PRINT'"◰‡ŴLAST FILE DESCRIPTION READ IS: "'"◰‡Ŵ";A$;'"‡☓LAST DISC FILE: ";ref$;"  LENGTH IS: ";NN%;'" ‡☓FROM NO.:";QQ%;"  TOTAL NO. INPUT: ";N9;':ENDPROC
  136.  
  137. 12000DEFFNusing(format$,no)
  138.  
  139. 12010LOCAL numb$,sp$,D%,L%,@%
  140.  
  141. 12020numb$=STR$(no)
  142.  
  143. 12030IF no>0 AND ASC(format$)=45 THEN sp$=CHR$32:format$=MID$(format$,2)
  144.  
  145. 12040L%=LEN(format$)
  146.  
  147. 12050D%=INSTR(format$+CHR$32,".")
  148.  
  149. 12060IF D% THEN @%=(66048+L%-D%)*256 ELSE no=INT(no+.5)
  150.  
  151. 12070IF INSTR(numb$,"E") THEN =sp$+format$
  152.  
  153. 12080IF INSTR(numb$+".",".")>L%+1 THEN =sp$+format$
  154.  
  155. 12090format$=STR$(no)
  156.  
  157. 12100IF LEN(format$)>L% THEN =sp$+LEFT$(format$,L%)
  158.  
  159. 12110=sp$+RIGHT$(STRING$(L%," ")+format$,L%)
  160.  
  161. 12200DEFPROCserial:*FX5,2
  162.  
  163. 12210PRINT'"◰Enter Baud Rate of printer as follows"''"◰75=1, 150=2, 300=3, 1200=4, 2400=5"'"◰4800=6, 9600=7, 19200=8"
  164.  
  165. 12220bd%=GET-48:OSCLI "*FX8,"+STR$bd%
  166.  
  167. 12230*FX6,0
  168.  
  169. 12240PRINT'"Ŵ⇦OK":del=INKEY(250):ENDPROC
  170.  
  171. 12250DEFPROCwhere:REPEAT:PRINT''"◰‡☓⇦>⇨ Enter drive No. of data disc ⇦<⇨"'"◰‡☓  or RETURN for drive 0":inc%=GET-48:UNTIL (inc%>-1 AND inc%<7) OR inc%=-35:IF inc%=-35 inc%=0
  172.  
  173. 12260PRINT'"◰‡☓Enter data directory pathname⇨"'"◰‡☓or RETURN for current directory⇨"':INPUT dird$
  174.  
  175. 12270REM IF dird$="" THEN dird$="^"
  176.  
  177. 12280ENDPROC
  178.  
  179. 12300DEFPROCinit
  180.  
  181. 12310MODE 7:NN%=0:QQ%=0:K%=0:VDU23,1,0;0;0;0;
  182.  
  183. 12320arraysize%=10:dummy%=0:shape$="***.***"
  184.  
  185. 12330F4=1:ref$="None":N9=0:A$="No data"
  186.  
  187. 12340DIM X1(240,arraysize%),X(240,arraysize%),I%(61)
  188.  
  189. 12350PRINT"◰‡☓FULL ONE WAY ANALYSIS OF VARIANCE -"'"◰‡☓INCOMPLETE CELLS ALLOWED R.de V 1989"''
  190.  
  191. 12360PRINT"‹‡☓Data format allows 7 figure display "'"‹‡☓including the decimal point!"
  192.  
  193. 12370REPEAT:PRINT"◰‡☓Enter preferred data format in the"'"◰‡☓form ***.*** or RETURN for default";:INPUT shape$:UNTIL LEN(shape$)=7 OR LEN(shape$)=0:IF LEN(shape$)=0 shape$="***.***"
  194.  
  195. 12400PRINT'"◰‡☓Enter 1 to process all data inc."'"◰‡☓zero and negative values or RETURN"'"◰‡☓to treat values < 0.001 as missing ":dummy%=GET:IF dummy%=13 dummy%=0
  196.  
  197. 12410PRINT'"◰‡☓>⇨Full editing input=F else RETURN":D$=GET$
  198.  
  199. 12500ENDPROC
  200.  
  201. 12600DEFPROCdim
  202.  
  203. 12610DIM A3(arraysize%*25),Q(250):ref$="Not on file"
  204.  
  205. 12690ENDPROC
  206.  
  207. 12700DEFPROCos:PRINT'"◰‡☓>  OPERATING SYSTEM CALL (eg *CAT <"':INPUT"Enter call (key shift to scroll)",SW$:VDU14:OSCLI SW$:VDU15:PRINT"◰‡☓>  Press a key to end delay  <":del=INKEY(2000)
  208.  
  209. 13000ENDPROC
  210.  
  211. >*SPOOL
  212.  
  213.